﻿<%@ Page Language="C#" MasterPageFile="~/Themes/MasterPage.master" %>
<script runat="server">
    protected override void OnLoad(EventArgs e)
    {
        newsCategories.ParentId = SiteContext.Current.BaseNodeId;
        newsCategories.BuilderLinkUrlHandler += new Func<object, string>(SiteUrls.Urls.NewsSearch);
        newsCategoriesIcon.ParentId = SiteContext.Current.BaseNodeId;
        newsCategoriesIcon.BuilderLinkUrlHandler += new Func<object, string>(SiteUrls.Urls.NewsSearch);
    }

    private string GetImageTitle()
    {
        string imageName=string.Empty;
        switch (SiteContext.Current.BaseNodeId)
        {
            case 4 :
                imageName = "project_title.gif";
                break;
            default:
                break; 
        }

        if (string.IsNullOrEmpty(imageName))
            return string.Empty;
        else
            return Globals.GetSkinPath(string.Format("/Images/{0}", imageName));
    }

    public int CategoryId
    {
        get { return SiteContext.Current.CategoryId; }
    }

    private string NodeTitle
    {
        get { return TreeTables.NewsCategories.GetCategoryName(SiteContext.Current.BaseNodeId); }
    }

    private string CurrentCategoryName
    {
        get { return TreeTables.NewsCategories.GetCategoryName(this.CategoryId); }
    }
    
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" runat="Server">
    <lswweb:SkinControl ID="banner" SkinFileName="Globals_ImageBanner.ascx" runat="server" />
    <lswweb:SkinControl ID="breadcrumb" SkinFileName="Globals_Breadcrumb.ascx" runat="server" />
 
    <div id="left_content">
        <img src="<%= GetImageTitle() %>" alt="" width="182" height="34" />            
        <div id="lefNav_top"></div>
        <div id="lefNav">
            <lswweb:TreeList ID="newsCategories" TreeType="NewsCategories" SkinFileName="Globals_RepeaterOnlyTitle.ascx" runat="server"></lswweb:TreeList>
        </div>
        <div id="lefNav_bottom">
        </div>
    </div>
    <div id="main_content">
        <h2><%= NodeTitle%></h2>
        <div class="imgList iconImage">
            <lswweb:TreeList ID="newsCategoriesIcon" PageSize="4" TreeType="NewsCategories" SkinFileName="Globals_TreeIconImageOrTitle.ascx" IsRenderTag="false" runat="server"></lswweb:TreeList>            
        </div>
    </div>
    
    <div class="cler"></div>
</asp:Content>
